package com.niit.blog.entity.page;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class PageResponse {
    private String code;

    private String errMsg;

    private Object data;

    public PageResponse(String code, String errMsg, Object data) {
        this.code = code;
        this.errMsg = errMsg;
        this.data = data;
    }

    public PageResponse(String code, String errMsg) {
        this.code = code;
        this.errMsg = errMsg;
    }

    public static PageResponse suc(Object data){
        return new PageResponse("200", "操作成功", data);
    }

    public static PageResponse err(String errMsg){
        return new PageResponse("400", errMsg);
    }

}